<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box{
      width:200px;
      height:200px;
      background: red;
    }
    .box2{
      width:200px;
      height:200px;
      background: rgb(38, 55, 151);
    }
  </style>
</head>
<body>
  <div id="app">
    <div class="box"></div>
    <div v-bind:class="cls"></div>
    <hr>
    <div v-bind:class="num===0?'box':'box2'"></div>
    <hr>
    <div v-bind:aaa="num2">aaa</div>
    <hr>
    <div :class="cls"></div>
    <hr>
    <div :class="num===0?'box':'box2'"></div>
    <hr>
    <div :aaa="num2">aaa</div>
  </div>
  <script src="./vue.js"></script>
  <script>
    const vm = new Vue({
      el:"#app",
      data:{
       cls:"box",
       num:1,
       num2:"哈哈哈"
      }
     
    })
  </script>
</body>
</html>